package my.mall.db.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

/**
 * <p>
 * 素材库
 * </p>
 *
 * @author fengbo
 * @since 2024-04-22
 */
@TableName("mall_media")
class Media {

    @TableId(value = "id", type = IdType.AUTO)
    var id: Long? = null

    /**
     * 素材名称
     */
    var mediaName: String? = null

    /**
     * 素材类型：1-图片；2-视频
     */
    var mediaType: Byte? = null

    /**
     * 素材URL
     */
    var mediaUrl: String? = null

    /**
     * 素材组ID
     */
    var groupId: Long? = null

    /**
     * 店铺ID
     */
    var storeId: Long? = null

    /**
     * 删除标识：0-未删除；1-已删除
     */
    var deletedFlag: Byte? = null

    /**
     * 素材图片大小，单位K
     */
    var mediaSize: Int? = null

    /**
     * 素材图片高
     */
    var mediaHeight: Double? = null

    /**
     * 素材图片宽
     */
    var mediaWidth: Double? = null

    /**
     * 素材MD5值
     */
    var mediaMd5: String? = null

    companion object {

        const val ID : String = "id"


        const val MEDIA_NAME : String = "media_name"


        const val MEDIA_TYPE : String = "media_type"


        const val MEDIA_URL : String = "media_url"


        const val GROUP_ID : String = "group_id"


        const val STORE_ID : String = "store_id"


        const val DELETED_FLAG : String = "deleted_flag"


        const val MEDIA_SIZE : String = "media_size"


        const val MEDIA_HEIGHT : String = "media_height"


        const val MEDIA_WIDTH : String = "media_width"


        const val MEDIA_MD5 : String = "media_md5"

    }

    override fun toString(): String {
        return "Media{" +
        "id=" + id +
        ", mediaName=" + mediaName +
        ", mediaType=" + mediaType +
        ", mediaUrl=" + mediaUrl +
        ", groupId=" + groupId +
        ", storeId=" + storeId +
        ", deletedFlag=" + deletedFlag +
        ", mediaSize=" + mediaSize +
        ", mediaHeight=" + mediaHeight +
        ", mediaWidth=" + mediaWidth +
        ", mediaMd5=" + mediaMd5 +
        "}"
    }
}
